/*************************************************************************
	> File Name: 004.数学函数库.c
	> Author: Maureen 
	> Mail: Maureen@qq.com 
	> Created Time: 五  8/20 20:03:59 2021
 ************************************************************************/

#include <stdio.h>
#include <math.h>

/* 数学函数库 <math.h>
 * 指数函数：double pow(double a, double b); 
 *          pow(2, 3) = 8
 * 开平方函数：double sqrt(double x);
 *          sqrt(16) = 4
 * 上取整函数：double ceil(double x);
 *          ceil(4.1) = 5
 * 下取整函数：double floor(double x);
 *          floor(4.9) = 4
 * 整数绝对值函数：int abs(int x);
 *          abs(-4) = 4;
 * 实数绝对值函数：double fabs(double x);
 *          fabs(-4.5) = 4.5
 * 以e为底对数函数：double log(double x);
 *          log(9) = 2.197225...
 * 以10为底对数函数：double log10(double x);
 *          log10(1000) = 3
 * acos函数：返回以弧度表示的x的反余弦 double acos(double x); x为角度的弧度值
 *          acos(-1) = 3.1415926
 */

#define PI acos(-1)
int main() {
    printf("输出数字x的立方根:\n");
    double x;
    scanf("%lf", &x);
    printf("%lf\n", pow(x, 1.0 / 3.0));

    printf("读入角度值，将角度值转换为弧度值:\n");
    scanf("%lf", &x);
    printf("%lf\n", PI / 180.0 * x);

    return 0;
}
/*测试数据:
输出数字x的立方根:
27
3.000000
读入角度值，将角度值转换为弧度值:
180
3.141593
*/
